package cn.lg.soar.common.util.trans.model;

import cn.lg.soar.common.util.trans.handler.ITranslateHandler;
import lombok.Getter;
import lombok.Setter;

import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;

/**
 * @author luguoxiang
 * @date 2022/8/31
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Getter
@Setter
public class TranslateContext<T> {

    /**
     * java数据类型
     */
    private final Class<T> javaType;

    /**
     * 所有注解
     */
    private final Annotation[] annotations;

    /**
     * 处理器
     */
    private final ITranslateHandler<T> handler;

    /**
     * java带注释成员
     */
    private final AnnotatedElement annotated;

    /**
     * 翻译名称
     */
    private String translateName;

    public TranslateContext(Class<T> javaType, Annotation[] annotations, ITranslateHandler<?> handler, AnnotatedElement annotated) {
        this.javaType = javaType;
        this.annotations = annotations;
        this.handler = (ITranslateHandler<T>)handler;
        this.annotated = annotated;
    }

}
